home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
basic
/
Crazy8.src.lha
/
Scource
/
NewSetLocale.bb
< prev
next >
Wrap
Text File
|
1998-08-12
|
3KB
|
94 lines
;card set selector
;Curt Esser
;camge@ix.netcom.com
;last modified 4/18/98
WBStartup
WBenchToFront_
v$="$VER: Crazy8.card.selector v2.6a (4/98) by Curt Esser"
MaxLen pa$=192 ;needed for file requestor
MaxLen fi$=192
pa$="Cards" ;default path
SetErr ;in case the program is moved
Request "Error!","Put this program in|the Crazy 8's drawer|and try again!"," OK "
End
End SetErr
LoadPalette 0,"cards/3d.deck" ;load the palette
ClrErr
ScreenPens 2,4,6,7,1,3,1 ;fix requestor colours
BitMap 0,320,220,3 ;open bitmap & screen & window
BitMap 1,320,200,3 ;this for the window
Screen 0,0,0,320,220,3,0,"Crazy 8 Cardset Selector",0,1,0
MenusOff
Use Palette 0
Window 0,0,15,320,200,$0800|$100|$1000,"",0,1
CatchDosErrs
Repeat
.getpic
fi$="Click on Cancel to Exit" ;default file name
;OK - get the name of a picture file
cardpic$= ASLFileRequest$ ("Select a Crazy8's Card Set",pa$,fi$,0,12,320,188)
If cardpic$="" Then End
If Exists (cardpic$)
ILBMInfo cardpic$ ;check the picture
If ILBMWidth<>320 OR ILBMHeight<>200 OR ILBMDepth<>3 ;not even the right size!
er$=fi$+"|Non-standard picture size!|Please try again!"
Request "Picture Error!",er$,"aaarrrgghhh!"
Goto getpic ;so try again
EndIf
Else
End
EndIf
LoadBitMap 1,cardpic$ ;load the pic
;Use Palette 0 ;and use game palette
BitMaptoWindow 1,0
;now ask 'em if it's the right one
answer=(Request ("Please Confirm:","OK to use this|set of cards?"," Yes | No! "))
Until answer=1 ;if no, go try again
Use BitMap 1
For shp=0 To 57 ;OK, grab the shapes
GetaShape shp,column,row,24,32
MidHandle shp
column+25
If column>250
column=0
row+33
EndIf
Next shp
;ready to save the shapes, but set an error trap first!
SetErr
Request "Save Error!","Unable to save|the Card File"," Oh, NO! "
End
End SetErr
SaveShapes 0,52,"data/card.shapes" ;first the cards
LoadShapes 58,"data/gad.shapes" ;now we need to update the
;gadget shape file too
For i=64 To 68 ;by copying in the new
Free Shape i ;shapes grabbed from the pic
CopyShape i-11,i
Next
SaveShapes 58,69,"data/gad.shapes" ;and save them too
Request "OK!","All Done!"," Great! " ;that's it!
VWait 50
ClrErr
VWait 50
End